package day04;

public class Animal {
        public String noise() {
            return "Animal";
        }
        public static void main(String[] args) {
            Cat cat = null;
            Animal animal = new Dog();
            if (animal instanceof Cat) {
                cat = (Cat) animal;
                System.out.println(cat.noise());
            } else {
                System.out.println("animal is not Cat's instance");
            }
        }
    }





